Date.prototype.getCurrentMonthDays = function(){
    //获取当前月份有多少天
    let  tempDate = new Date("2000-01-01");
    tempDate.setFullYear(this.getFullYear());
    tempDate.setMonth(this.getMonth()+1);
    tempDate.setDate(0);
    return tempDate.getDate();
}

Date.prototype.getPrevMonthDays = function(){
    //获取上一个月份有多少天
    let  tempDate = new Date("2000-01-01");
    tempDate.setFullYear(this.getFullYear());
    tempDate.setMonth(this.getMonth());
    tempDate.setDate(0);
    return tempDate.getDate();
}

Date.prototype.getCurrentMonthFirstDayWeek = function(){
    //获取当前月的第一天是星期几
    let  tempDate = new Date("2000-01-01");
    tempDate.setFullYear(this.getFullYear());
    tempDate.setMonth(this.getMonth());
    tempDate.setDate(1);
    return tempDate.getDay();
}
//格式时间
Date.prototype.format  = function(str){
    let  year  = this.getFullYear();
    let  month  =this.getMonth()+1;
    let  day  = this.getDate();
    let hours  = this.getHours();
    let  mins  = this.getMinutes();
    let  sec  = this.getSeconds();

    return  str.replace("yyyy",year).replace("mm",month).replace("dd",day).replace("hh",hours).replace("MM",mins).replace("ss",sec);
    

}